package com.ethink.warehouse.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.warehouse.api.info.MateInventoryOtherOutLogInfo;
import com.ethink.warehouse.common.entity.MateInventoryOtherOutLog;

/**
 * 其他出库 Converter转换器
 *
 * @author default
 * @date 2023-02-08
 */
@Component
public class MateInventoryOtherOutLogConverter implements Converter<MateInventoryOtherOutLogInfo, MateInventoryOtherOutLog> {

    @Override
    public MateInventoryOtherOutLog convertTo(MateInventoryOtherOutLogInfo info) {
        if(info == null) {
            return null;
        }
        MateInventoryOtherOutLog entity = new MateInventoryOtherOutLog ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public MateInventoryOtherOutLogInfo convertFrom(MateInventoryOtherOutLog entity) {
        if(entity == null) {
            return null;
        }
        MateInventoryOtherOutLogInfo info = new MateInventoryOtherOutLogInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
